Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Sync bound for Body #18

Merged
merged 1 commit into from
Jul 25, 2020
Merged

Conversation

lnicola
Copy link
Contributor

@lnicola lnicola commented Jun 8, 2020

Update for hyperium/hyper#2187.

TBH, bounds like

impl<D, E> Entity for ChunkedReadFile<D, E>
where
    D: 'static + Send + Sync + Buf + From<Vec<u8>> + From<&'static [u8]>,
    E: 'static
        + Send
        + Sync
        + Into<Box<dyn StdError + Send + Sync>>
        + From<Box<dyn StdError + Send + Sync>>,

aren't exactly easy to understand or work with. Maybe it's worth using Body instead?

@scottlamb
Copy link
Owner

I think this needs a major version bump, right? In particular, BodyWriter::with_chunk_size returns a boxed stream that won't be accepted anymore by versions of hyper older than that commit.

TBH, bounds like [...] aren't exactly easy to understand or work with. Maybe it's worth using Body instead?

Yeah, it'd be a lot simpler if we got rid of all that. I'd like to see how tokio-rs/bytes#359 shakes out, though.

@lnicola
Copy link
Contributor Author

lnicola commented Jun 8, 2020

I suppose so. I guess this was a breaking change in hyper too, but didn't get a semver bump.

@lnicola
Copy link
Contributor Author

lnicola commented Jul 24, 2020

Do you think we could merge this? The crate is on 0.2, so a bump to 0.3 wouldn't be the end of the world.

@scottlamb
Copy link
Owner

Oh, thanks for the reminder. Yes, I'll merge.

I agree, a bump to 0.3 isn't much of a problem. We might be the only two users of this crate in the world anyway; I haven't exactly advertised well.

I was wondering after your last comment about it being a breaking change in hyper if they would end up yanking it or something but it's been more than a month so I think we can safely assume not...

@scottlamb scottlamb merged commit 9f583a1 into scottlamb:master Jul 25, 2020
@lnicola lnicola deleted the no-body-sync branch July 25, 2020 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants